<template>
  <el-card :bordered="false" class="storeOrderDetails">
    <el-page-header @back="$router.go(-1)" style="margin-bottom:10px"></el-page-header>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      :labelWidth="labelWidth"
      class="demo-ruleForm"
    >
      <el-card
        class="box-card"
        shadow="never"
        style="margin: 20px 0;background-color:rgba(215, 215, 215, 0.5);"
      >
        <div slot="header" class="clearfix">
          <h3 class="header_title">配送中</h3>
        </div>
        <el-row :gutter="10">
          <el-col :xs="8" :md="8">
            <el-form-item label="门店采购单号："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="创单人："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="制单时间："></el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <!-- 门店采购信息 -->
      <el-card class="box-card" shadow="never" style="margin-bottom: 20px;">
        <div slot="header" class="clearfix">
          <h3>门店采购信息</h3>
        </div>
        <el-row :gutter="10">
          <el-col :xs="8" :md="8">
            <el-form-item label="门店名称："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="联系人："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="联系手机号："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="门店地址："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="预计送达日期："></el-form-item>
          </el-col>
          <el-col :xs="8" :md="8">
            <el-form-item label="备注："></el-form-item>
          </el-col>
        </el-row>
        <h3>采购商品明细</h3>
        <buyingIfor ref="buyingIfor" style="margin:10px 0px 10px 10px" />
      </el-card>
      <el-card class="box-card" shadow="never" style="margin-bottom: 20px;">
        <div slot="header" class="clearfix">
          <h3>关联单据</h3>
        </div>
        <el-card class="box-card" shadow="never">
          <div slot="header" class="clearfix">
            <div class="title">
              <div>
                <h3>
                  采购出库单
                  <el-button size="mini" round type="primary">待出库</el-button>
                </h3>
              </div>
              <div>总仓出库：{{ruleForm.chuku}}</div>
            </div>
          </div>
          <el-row :gutter="10">
            <el-col :xs="8" :md="8">
              <el-form-item label="联系人："></el-form-item>
            </el-col>
            <el-col :xs="8" :md="8">
              <el-form-item label="联系电话："></el-form-item>
            </el-col>
            <el-col :xs="8" :md="8">
              <el-form-item label="出库时间："></el-form-item>
            </el-col>
            <el-col :xs="8" :md="8">
              <el-form-item label="地址："></el-form-item>
            </el-col>
            <el-col :xs="8" :md="8">
              <el-form-item label="备注："></el-form-item>
            </el-col>
            <el-col :xs="8" :md="8">
              <el-form-item label="出库凭证：" prop="lmtb" ref="lmtbUpload">
                <el-upload
                  action="#"
                  list-type="picture-card"
                  :auto-upload="true"
                  :before-upload="beforeUpload"
                  :on-change="handleChange"
                  :file-list="fileList"
                  :limit="1"
                >
                  <i slot="default" class="el-icon-plus"></i>
                  <!-- <div slot="tip" class="el-upload__tip">建议上传大小不超过1M，尺寸为 326*412 的图片</div> -->
                  <div slot="file" slot-scope="{file}">
                    <img class="el-upload-list__item-thumbnail" :src="file.url" alt />
                    <span class="el-upload-list__item-actions">
                      <span
                        class="el-upload-list__item-preview"
                        @click="handlePictureCardPreview(file)"
                      >
                        <i class="el-icon-zoom-in"></i>
                      </span>
                      <span class="el-upload-list__item-delete" @click="delUplod(file)">
                        <i class="el-icon-delete"></i>
                      </span>
                    </span>
                  </div>
                </el-upload>
                <el-dialog :visible.sync="dialogVisibleImg">
                  <img width="100%" :src="dialogImageUrl" alt />
                </el-dialog>
                <!-- modal -->
                <cropper-modal
                  ref="cropperModal"
                  :optionsData="optionsData"
                  @ok="handleCropperSuccess"
                ></cropper-modal>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-card>
      <div class="content">
        <el-button @click="save('ruleForm')" type="primary">保存</el-button>
        <el-button @click="quxiao('ruleForm')">取消</el-button>
      </div>
    </el-form>
  </el-card>
</template>

<script src='./index.js'></script>

<style lang="scss">
.storeOrderDetails {
  .content {
    text-align: center;
    margin: 20px 0px;
    button {
      margin-right: 10px;
    }
  }
  .mdweizhi {
    display: flex;
    .jwd {
      span {
        padding-right: 10px;
      }
      .el-form-item__label {
        text-align: right;
        width: 50px !important;
      }
      .el-form-item__content {
        margin-left: 0px !important;
        margin-right: 20px;
      }
    }
  }
  .box-card {
    .header_title {
      background: rgba(102, 204, 102, 1);
      display: inline-block;
      padding: 5px 10px;
      color: #fff;
    }
    .title {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    h3 {
      margin: 0;
    }
  }
}
</style>
